package y2017.date1208.文件归档;

import com.lu.jdog.util.FileUtil;

import java.io.File;
import java.io.FileFilter;

public class Gui {
    public static void guiNa(String springLib, String guiPath, FileFilter fileFilter) {
        File springDir = new File(springLib);
        if (!springDir.exists() && !springDir.isDirectory()) {
            return;
        }
        File guiDir = new File(guiPath);
        if (!guiDir.exists()) {
            guiDir.mkdir();
        }
        if (!guiDir.isDirectory()) {
            System.err.println(guiPath + "是一个文件");
            return;
        }
        File[] files = springDir.listFiles(fileFilter);

        for (File file : files) {
            byte[] bytes = FileUtil.readBytes(file);
            File outFile = new File(guiPath, file.getName());
            FileUtil.writeBytes(outFile, bytes);
        }


    }
}
